package com.wjpeng.wms.web.controller;

import com.wjpeng.wms.domain.ProductStock;
import com.wjpeng.wms.query.ProductStockQueryObject;
import com.wjpeng.wms.service.*;
import com.wjpeng.wms.util.JSONResult;
import com.wjpeng.wms.util.RequiredPermission;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("productStock")
public class ProductStockController {
    @Autowired
    private IProductStockService productStockService;

    @Autowired
    private IDepotService depotService;

    @Autowired
    private IBrandService brandService;

    @RequestMapping("list")
    @RequiredPermission("员工列表")
    public String list(@ModelAttribute("qo") ProductStockQueryObject qo, Model model){
        model.addAttribute("result",productStockService.result(qo));
        model.addAttribute("depots",depotService.list());
        model.addAttribute("brands",brandService.list());

        return "productStock/list";
    }



}
